<?
$this->placeholder('page_title')->set($this->page->get_title()); 

$lead = $this->page->get_lead();
if ($this->page->get_format_lead()): 
else:
    $lead = sprintf('<b>%s</b>', $lead);
endif;

if ($this->page->get_format_content()):

    if (preg_match('~(<p[^>]*>)(.*)$~', $this->page->get_content(), $match)):
        $content = $match[1] . $lead . $match[2];
    else:
        $content = '<p>' . $lead . $this->page->get_content() . '</p>';
    endif;
    echo $content;
else: // do not format content
?>
<p>
    <?= $lead ?>
<?= $this->page->get_content() ?></p>
<? endif; // format content
?>
<? if ($this->pages): ?>
<ul class="subpages">
    <? foreach ($this->pages as $page): ?>
    <li><?= $page->get_title() ?></li>
    <? endforeach; ?>
</ul>
<? endif; // subpages ?>

<? if ($user = Model_Users::current_user()):
if ($user->can('pages_admin')):
    echo $this->partial('edit_page.phtml', array('page_id' => $this->page->identity()));
endif;
endif;
